/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Random;

/**
 * <p>Project: javase2203 - If3
 * <p>Powered by webrx On 2022-07-13 15:47:35
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class If3 {
    public static void main(String[] args) {
        Random rand = new Random();
        float ff =  rand.nextFloat(1,6);
        System.out.println(ff);

        //判断闰年
        int year = 2024;
        if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0) {
            System.out.printf("%d年是：闰年", year);
        } else {
            System.out.printf("%d年是：平年", year);
        }
        System.out.println();

        boolean f = year % 100 != 0 && year % 4 == 0 || year % 400 == 0;
        if(f){
            System.out.printf("%d年是：闰年", year);
        }else{
            System.out.printf("%d年是：平年", year);
        }
    }
}
